import requests

url = "http://www.baidu.com"

headers = {
    "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36"
}

response = requests.get(url,headers=headers)

# text content
# 状态码
print(response.status_code)

# cookies 响应的cookie
print(response.cookies)

# 请求的cookies
print(response.request._cookies)

# request
print(response.request)

# 响应头
print(response.headers)
# 请求头
print(response.request.headers)

# 响应的url
print(response.url)
